import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
public class Main {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
       ListIterator<Integer> listIterator = list.listIterator(list.size());
       while(listIterator.hasPrevious()){
           System.out.println(listIterator.previous() + " ");
       }
    }
}